package com.epower.dao.epoweruser.impl;


import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.ali.luna.commons.dao.BaseDAOImpl;
import com.epower.dao.epoweruser.EpowerUserDAO;
import com.epower.dataobject.EpowerUserDO;
import java.util.List;
/***
 * DAO实现层
 * @author QuickDev
 *
 */
@Scope("singleton")
@Component("epowerUserDAO")
public class EpowerUserDAOImpl extends BaseDAOImpl implements EpowerUserDAO {
    /***
     * 查询单个对象
     */
	@Override
	public EpowerUserDO getEpowerUserByOption(EpowerUserDO epowerUser) {
		return (EpowerUserDO)getSqlMapClientTemplate().queryForObject("EpowerUserDAOImpl.GET-EPOWERUSER-BY-OPTION",epowerUser);
	}
    /***
     * 查询对象列表
     */
	@Override
	public List<EpowerUserDO> getEpowerUserListByOption(EpowerUserDO epowerUser) {
		return (List<EpowerUserDO>)getSqlMapClientTemplate().queryForList("EpowerUserDAOImpl.GET-EPOWERUSERList-BY-OPTION",epowerUser);
	}
    /***
     * 根据id查询对象
     */
	@Override
	public EpowerUserDO getEpowerUserById(Integer id) {
		return (EpowerUserDO)getSqlMapClientTemplate().queryForObject("EpowerUserDAOImpl.GET-EPOWERUSER-BY-ID",id);
	}
	
	/***
     * 删除操作
     */
	@Override
	public boolean deleteEpowerUserById(Integer id) {
		int num = getSqlMapClientTemplate().update("EpowerUserDAOImpl.DELETE-EPOWERUSER-BY-ID",
				id);
		return num == 0 ? false : true;
	}
    /***
     * 查询数量
     */
	@Override
	public Integer getEpowerUserCountByOption(EpowerUserDO epowerUser) {
		return (Integer)getSqlMapClientTemplate().queryForObject("EpowerUserDAOImpl.GET-EPOWERUSER-COUNT-BY-OPTION",epowerUser);
	}
    
    /***
     * 更新操作
     */
	@Override
	public boolean updateEpowerUserByOption(EpowerUserDO epowerUser) {
		int num = getSqlMapClientTemplate().update("EpowerUserDAOImpl.UPDATE-EPOWERUSER-BY-OPTION",
				epowerUser);
		return num == 0 ? false : true;
	}
    /***
	 * 添加操作
	 * 
	 * @param 
	 * @return
	 */
	@Override
	public Integer addEpowerUser(EpowerUserDO epowerUser) {
		return (Integer)getSqlMapClientTemplate().insert("EpowerUserDAOImpl.ADD-EPOWERUSER",
				epowerUser);
	}
}